{% block sw_language_switch %}
<div class="sw-language-switch">
    {% block sw_language_switch_modal %}
    <sw-modal
        v-if="showUnsavedChangesModal"
        :title="$tc('sw-language-switch.titleModalUnsavedChanges')"
        variant="small"
        @modal-close="onCloseChangesModal"
    >
        {% block sw_language_switch_message %}
        <p>{{ $tc('sw-language-switch.messageModalUnsavedChanges') }}</p>
        {% endblock %}
        {% block sw_language_switch_footer %}
        <template #modal-footer>
            {% block sw_language_switch_footer_button_close %}
            <mt-button
                id="sw-language-switch-close-button"
                size="small"
                variant="secondary"
                @click="onCloseChangesModal"
            >
                {{ $tc('global.default.cancel') }}
            </mt-button>
            {% endblock %}

            {% block sw_language_switch_footer_button_revert %}
            <mt-button
                id="sw-language-switch-revert-changes-button"
                size="small"
                variant="secondary"
                @click="onClickRevertUnsavedChanges"
            >
                {{ $tc('sw-language-switch.titleModalButtonRevertUnsavedChanges') }}
            </mt-button>
            {% endblock %}

            {% block sw_language_switch_footer_button_save %}
            <mt-button
                id="sw-language-switch-save-changes-button"
                v-tooltip="{
                    message: $tc('sw-privileges.tooltip.warning'),
                    disabled: allowEdit,
                    showOnDisabledElements: true
                }"
                variant="primary"
                :disabled="!allowEdit || undefined"
                size="small"
                @click="onClickSaveChanges"
            >
                {{ $tc('global.default.save') }}
            </mt-button>
            {% endblock %}
        </template>
        {% endblock %}
    </sw-modal>
    {% endblock %}
    {% block sw_language_switch_select %}
    <sw-entity-single-select
        id="language"
        class="sw-language-switch__select"
        entity="language"
        :disabled="disabled || undefined"
        :criteria="languageCriteria"
        size="medium"
        required
        :value="languageId"
        :result-limit="Infinity"
        @update:value="onInput"
    />
    {% endblock %}
</div>
{% endblock %}
